package main

import (
	"github.com/hyperledger/fabric-contract-api-go/contractapi"
)

func main() {
	simpleContract := new(SimpleContract)
	simpleContract.TransactionContextHandler = new(CustomTransactionContext)
	simpleContract.UnknownTransaction = UnknownTransactionHandler
	simpleContract.BeforeTransaction= GetWorldState
	simpleContract.Name ="jiandanheyue"

	complexContract:=new (ComplexContract)
	complexContract.TransactionContextHandler=new(CustomTransactionContext)
	complexContract.UnknownTransaction = UnknownTransactionHandler
	complexContract.BeforeTransaction=GetWorldState
	complexContract.Name="fuzaheyue"

	modelContract:=new (ModelContract)
	modelContract.TransactionContextHandler=new(contractapi.TransactionContext)
	modelContract.UnknownTransaction = UnknownTransactionHandler2
	modelContract.Name="moxingheyue"

	cc, err := contractapi.NewChaincode(simpleContract,complexContract,modelContract)
	cc.DefaultContract=modelContract.GetName()

	if err != nil {
		panic(err.Error())
	}

	if err := cc.Start(); err != nil {
		panic(err.Error())
	}
}


